import path from "path";

export class ComponentInfo {
  private componentsPath: string; // = path.resolve("../first/components/");
  private componentName: string;
  private componentIndexJs: string;
  private componentResFolder: string;
  private componentCssFolder: string;
  private componentImgFolder: string;
  private componentJsFolder: string;
  private componentIndexFile: string;
  private componentRootFolder: string;

  constructor(componentName: string, projectRoot: string) {
    this.componentsPath = path.join(projectRoot, "first/components");
    this.componentName = componentName;

    this.componentRootFolder = path.join(
      this.componentsPath,
      this.componentName
    );

    this.componentIndexFile = path.join(this.componentRootFolder, "index.html");
    this.componentIndexJs = path.join(
      this.componentRootFolder,
      `res/js/${this.componentName}_index.js`
    );
    this.componentResFolder = path.join(this.componentRootFolder, "res");
    this.componentCssFolder = path.join(this.componentRootFolder, "res/css");
    this.componentImgFolder = path.join(this.componentRootFolder, "res/img");
    this.componentJsFolder = path.join(this.componentRootFolder, "res/js");
  }

  public getComponentPath() {
    return this.componentsPath;
  }

  public getComponentName() {
    return this.componentName;
  }

  public getComponentRootFolderPath() {
    return this.componentRootFolder;
  }

  public getComponentIndexFilePath() {
    return this.componentIndexFile;
  }

  public getComponentIndexJs() {
    return this.componentIndexJs;
  }

  public getComponentResFolderPath() {
    return this.componentResFolder;
  }
  public getComponentCssFolderPath() {
    return this.componentCssFolder;
  }
  public getComponentImgFolderPath() {
    return this.componentImgFolder;
  }
  public getComponentJsFolderPath() {
    return this.componentJsFolder;
  }
}
